import request from '@/utils/request'

// 查询项目列表
export function listProject(query) {
  return request({
    url: '/system/project/list',
    method: 'get',
    params: query
  })
}

// 查询项目详细
export function getProject(projectId) {
  return request({
    url: '/system/project/' + projectId,
    method: 'get'
  })
}

// 新增项目
export function addProject(data) {
  return request({
    url: '/system/project',
    method: 'post',
    data: data
  })
}

// 修改项目
export function updateProject(data) {
  return request({
    url: '/system/project',
    method: 'put',
    data: data
  })
}

// 删除项目
export function delProject(projectId) {
  return request({
    url: '/system/project/' + projectId,
    method: 'delete'
  })
}

//查询项目中的文献列表
export function listProjectLiterature(query) {
  return request({
    url: '/system/project/literature/'+query.projectId,
    method: 'get',
    params: query
  })
}

//导入项目中的文献
export function importProjectLiterature(projectId,literatureList) {
  return request({
    url: `/system/project/import/${literatureList.join(',')}`,
    method: 'post',
    params: {projectId}
  })
}

//删除项目中的文献
export function removeLiterature(projectId,literatureList) {
  return request({
    url: `/system/project/literature/project/${literatureList.join(',')}`,
    method: 'delete',
    params: {projectId}
  })
}

